package com.peisong.mapper;


import com.peisong.domain.Test;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.ArrayList;

@Mapper
public interface TestMapper {

    @Select("select * from user where username=#{username}")
    Test findByUsername(String username);

    @Select("insert into user(username,password,create_time,update_time)" +
            " values(#{username},#{password},now(),now())")
    void register(String username, String password);

    @Update("update user set nickname=#{nickname},email=#{email},update_time=#{updateTime} where id=#{id}")
    void update(Test test);
}
